package org.freespace.exception;


import org.freespace.api.IExceptionCode;

/**
 * 自定义API异常
 * Created by macro on 2020/2/27.
 */
public class CommonException extends RuntimeException {
    private IExceptionCode exceptionCode;

    public CommonException(IExceptionCode exceptionCode) {
        super(exceptionCode.getMessage());
        this.exceptionCode = exceptionCode;
    }

    public CommonException(String message) {
        super(message);
    }

    public CommonException(Throwable cause) {
        super(cause);
    }

    public CommonException(String message, Throwable cause) {
        super(message, cause);
    }

    public IExceptionCode getErrorCode() {
        return exceptionCode;
    }
}
